<ion-header>
  <ion-toolbar class="orange-bar">
    <ion-buttons slot="start">
      <ion-button color="light" (click)="goBack()">
        <ion-icon name="ios-arrow-back"></ion-icon>
      </ion-button>
    </ion-buttons>
    <ion-title>提现</ion-title>
    <ion-buttons slot="end">
      <ion-button color="light" class="record-btn" [routerLink]="['/auth/user-records', {userRole: userRole, recordType: 'withdrawal'}]">
        提现记录
      </ion-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>

<ion-content padding>
  <!--<ion-radio-group [(ngModel)]="policy" text-center class="type-box" (ionChange)="togglePolicy()">-->
    <!--<label>次日到账 <ion-radio value="T1"></ion-radio></label>-->
    <!--<label>当日到账 <ion-radio value="T0"></ion-radio></label>-->
  <!--</ion-radio-group>-->
  <div class="flex-box">
    <ion-input type="number" pattern="[0-9.]*" placeholder="请输入提现金额" [(ngModel)]="amount" (ionChange)="limitValue($event)"></ion-input><span>元</span>
  </div>
  <ion-list lines="none" *ngIf="isShowBankArea">
    <ion-item detail (click)="openArea()">
      <ion-label *ngIf="city; else notCityBlock">
        <h5>开户行所在地</h5>
        <ion-text color="tertiary">{{city['prov_name'] + ' ' + city['city_name']}}</ion-text>
      </ion-label>
      <ng-template #notCityBlock>
        <ion-label>
          <h5>选择开户行所在地</h5>
          <ion-text color="tertiary">(提现金额大于5万或企业用户必选)</ion-text>
        </ion-label>
      </ng-template>
    </ion-item>
  </ion-list>
  <div padding-vertical>
    <ion-text color="tertiary">
      <span>账户余额 {{withdrawalOpt['balance']}}元</span>
    </ion-text>
    <ion-text color="tertiary">
      <span float-right>手续费 {{fee | number:'.2'}}元</span>
    </ion-text>
  </div>
  <div>
    <ion-text color="danger">
      <span>{{errMsg}}</span>
    </ion-text>
    &nbsp;
  </div>
  <div text-center>
    <a class="link-btn bg-orange" [class.disabled]="!amount || errMsg || (isShowBankArea && !city)" (click)="doWithdrawal()">确认提现</a>
  </div>
  <ion-text color="medium">
    <p class="tip-info">
      <ion-icon name="information-circle" color="tertiary"></ion-icon>温馨提示：<br>
      1.身份认证、账户存管开通、提现银行卡均设置成功后，才能进行提现操作；<br>
      2.提现必须为银行借记卡，不支持存折、信用卡提现；<br>
      3.严禁信用卡套现、转账、洗钱等行为，一经发现，将予以处罚，包括但不限于：限制交易、冻结账户、永久停止服务，并会影响银行征信记录；<br>
      4.提现到账时间：T+1到。<br>
      <!--工作日，每笔5万以下（含5万）实时到账；<br>-->
      <!--其他情况提现，。<br>-->
      实际到账时间依据陕坝农商行存管账户及提现银行而有所差异。
    </p>
  </ion-text>
</ion-content>
<!-- 地域选择 -->
<app-action-panel #bankAreaPanel>
  <app-bank-area [provinceList]="withdrawalOpt['provinceList']" (closeEmit)="closeBankArea($event)"></app-bank-area>
</app-action-panel>